package com.changba.schedule.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chongba.pojo.TaskInfoEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

public interface TaskInfoMapper extends BaseMapper<TaskInfoEntity> {

    @Select("select * from taskinfo where task_type = #{taskType} and priority = #{priority}")
    List<TaskInfoEntity> selectAll(@Param("taskType") Integer taskType,@Param("priority") Integer priority);

    @Select("select * from taskinfo where task_type = #{taskType} and priority = #{priority} and execute_time <= #{futureTime}")
    List<TaskInfoEntity> selectFuture(@Param("taskType") Integer taskType,@Param("priority") Integer priority, @Param("futureTime") Long futureTime);
}
